// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file hk_image.cpp
 * This source file contains the implementation of the described types in the IDL file.
 *
 * This file was generated by the tool fastddsgen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace {
char dummy;
}  // namespace
#endif  // _WIN32

#include "hk_image.h"

#include <fastcdr/Cdr.h>


#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>




hk_image::hk_image()
{
}

hk_image::~hk_image()
{
}

hk_image::hk_image(
        const hk_image& x)
{
    m_index = x.m_index;
    m_message = x.m_message;
    m_width = x.m_width;
    m_height = x.m_height;
    m_timestamp = x.m_timestamp;
    m_image_data = x.m_image_data;
}

hk_image::hk_image(
        hk_image&& x) noexcept
{
    m_index = x.m_index;
    m_message = std::move(x.m_message);
    m_width = x.m_width;
    m_height = x.m_height;
    m_timestamp = x.m_timestamp;
    m_image_data = std::move(x.m_image_data);
}

hk_image& hk_image::operator =(
        const hk_image& x)
{

    m_index = x.m_index;
    m_message = x.m_message;
    m_width = x.m_width;
    m_height = x.m_height;
    m_timestamp = x.m_timestamp;
    m_image_data = x.m_image_data;
    return *this;
}

hk_image& hk_image::operator =(
        hk_image&& x) noexcept
{

    m_index = x.m_index;
    m_message = std::move(x.m_message);
    m_width = x.m_width;
    m_height = x.m_height;
    m_timestamp = x.m_timestamp;
    m_image_data = std::move(x.m_image_data);
    return *this;
}

bool hk_image::operator ==(
        const hk_image& x) const
{
    return (m_index == x.m_index &&
           m_message == x.m_message &&
           m_width == x.m_width &&
           m_height == x.m_height &&
           m_timestamp == x.m_timestamp &&
           m_image_data == x.m_image_data);
}

bool hk_image::operator !=(
        const hk_image& x) const
{
    return !(*this == x);
}

/*!
 * @brief This function sets a value in member index
 * @param _index New value for member index
 */
void hk_image::index(
        uint32_t _index)
{
    m_index = _index;
}

/*!
 * @brief This function returns the value of member index
 * @return Value of member index
 */
uint32_t hk_image::index() const
{
    return m_index;
}

/*!
 * @brief This function returns a reference to member index
 * @return Reference to member index
 */
uint32_t& hk_image::index()
{
    return m_index;
}


/*!
 * @brief This function copies the value in member message
 * @param _message New value to be copied in member message
 */
void hk_image::message(
        const std::string& _message)
{
    m_message = _message;
}

/*!
 * @brief This function moves the value in member message
 * @param _message New value to be moved in member message
 */
void hk_image::message(
        std::string&& _message)
{
    m_message = std::move(_message);
}

/*!
 * @brief This function returns a constant reference to member message
 * @return Constant reference to member message
 */
const std::string& hk_image::message() const
{
    return m_message;
}

/*!
 * @brief This function returns a reference to member message
 * @return Reference to member message
 */
std::string& hk_image::message()
{
    return m_message;
}


/*!
 * @brief This function sets a value in member width
 * @param _width New value for member width
 */
void hk_image::width(
        uint16_t _width)
{
    m_width = _width;
}

/*!
 * @brief This function returns the value of member width
 * @return Value of member width
 */
uint16_t hk_image::width() const
{
    return m_width;
}

/*!
 * @brief This function returns a reference to member width
 * @return Reference to member width
 */
uint16_t& hk_image::width()
{
    return m_width;
}


/*!
 * @brief This function sets a value in member height
 * @param _height New value for member height
 */
void hk_image::height(
        uint16_t _height)
{
    m_height = _height;
}

/*!
 * @brief This function returns the value of member height
 * @return Value of member height
 */
uint16_t hk_image::height() const
{
    return m_height;
}

/*!
 * @brief This function returns a reference to member height
 * @return Reference to member height
 */
uint16_t& hk_image::height()
{
    return m_height;
}


/*!
 * @brief This function sets a value in member timestamp
 * @param _timestamp New value for member timestamp
 */
void hk_image::timestamp(
        uint64_t _timestamp)
{
    m_timestamp = _timestamp;
}

/*!
 * @brief This function returns the value of member timestamp
 * @return Value of member timestamp
 */
uint64_t hk_image::timestamp() const
{
    return m_timestamp;
}

/*!
 * @brief This function returns a reference to member timestamp
 * @return Reference to member timestamp
 */
uint64_t& hk_image::timestamp()
{
    return m_timestamp;
}


/*!
 * @brief This function copies the value in member image_data
 * @param _image_data New value to be copied in member image_data
 */
void hk_image::image_data(
        const std::array<uint8_t, 3*1280*1024>& _image_data)
{
    m_image_data = _image_data;
}

/*!
 * @brief This function moves the value in member image_data
 * @param _image_data New value to be moved in member image_data
 */
void hk_image::image_data(
        std::array<uint8_t, 3*1280*1024>&& _image_data)
{
    m_image_data = std::move(_image_data);
}

/*!
 * @brief This function returns a constant reference to member image_data
 * @return Constant reference to member image_data
 */
const std::array<uint8_t, 3*1280*1024>& hk_image::image_data() const
{
    return m_image_data;
}

/*!
 * @brief This function returns a reference to member image_data
 * @return Reference to member image_data
 */
std::array<uint8_t, 3*1280*1024>& hk_image::image_data()
{
    return m_image_data;
}


// Include auxiliary functions like for serializing/deserializing.
#include "hk_imageCdrAux.ipp"

